package com.example.movie.mate.startup;

import com.example.movie.mate.service.IMovieService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

@Component
public class CacheStartupRunner implements ApplicationRunner {

    @Autowired
    private IMovieService movieService;

    @Override
    public void run(ApplicationArguments args) throws Exception {
        movieService.rebuildCache();
    }

}
